﻿Imports System.IO

Public Class Form1

    Private Sub AboutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AboutToolStripMenuItem.Click
        AboutBox.Show()
    End Sub

    Private Sub OpenToolStripButton_Click(sender As Object, e As EventArgs) Handles OpenToolStripButton.Click
        OpenFileDialog1.ShowDialog()
    End Sub

    Private Sub OpenFileDialog1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
        Dim oProp As System.Windows.Forms.OpenFileDialog = sender
        ToolStripTextBox1.Text = oProp.FileName
    End Sub

    Private Sub CopyToolStripButton_Click(sender As Object, e As EventArgs) Handles CopyToolStripButton.Click
        If Not File.Exists(ToolStripTextBox1.Text) Then
            MsgBox("Windows PowerShell Script File missing", MsgBoxStyle.Exclamation, "Load Windows PowerShell Script File")
            Exit Sub
        End If
        Try
            LoadPowerShellScript(ToolStripTextBox1.Text)
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Load Windows PowerShell Script File")
        End Try
    End Sub

    Private Sub CautionBoxToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CautionBoxToolStripMenuItem.Click
        LoadTemplate("CautionBox")
    End Sub

    Private Sub ImportantBoxToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ImportantBoxToolStripMenuItem.Click
        LoadTemplate("ImportantBox")
    End Sub

    Private Sub NoteBoxToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NoteBoxToolStripMenuItem.Click
        LoadTemplate("NoteBox")
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://social.technet.microsoft.com/wiki/")
    End Sub

    Private Sub NewToolStripButton_Click(sender As Object, e As EventArgs) Handles NewToolStripButton.Click
        Me.Cursor = Cursors.WaitCursor
        WebBrowser1.Navigate("http://social.technet.microsoft.com/wiki/contents/articles/add.aspx")
        Me.Cursor = Cursors.Default
    End Sub

    Private Sub AADToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles AADToolStripMenuItem1.Click
        LoadTemplate("AADTroubleshooting")
    End Sub

    Private Sub FIMToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles FIMToolStripMenuItem1.Click
        LoadTemplate("FIMTroubleshooting")
    End Sub

    Private Sub AADToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AADToolStripMenuItem.Click
        LoadTemplate("AADAnnouncement")
    End Sub

    Private Sub FIMToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FIMToolStripMenuItem.Click
        LoadTemplate("FIMAnnouncement")
    End Sub

    
    Private Sub AADToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles AADToolStripMenuItem2.Click
        LoadTemplate("AADScriptBox")
    End Sub

    Private Sub FIMToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles FIMToolStripMenuItem2.Click
        LoadTemplate("FIMScriptBox")
    End Sub

    Private Sub PowerShellScriptToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles PowerShellScriptToolStripMenuItem1.Click
        OpenFileDialog1.ShowDialog()
    End Sub

    Private Sub HelpToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles HelpToolStripMenuItem.Click

    End Sub
End Class
